<template>
  <span class="edit_save_button">
    <a-button
      type="link"
      class="blue_btn lrpadding"
      v-if="!isEdit"
      @click="$emit('edit')"
      >{{ editText }}</a-button
    >
    <span v-else>
      <a-button type="link" class="gray_btn lrpadding" @click="$emit('cancel')">{{
        cancelText
      }}</a-button>
      <a-button type="link" class="blue_btn" @click="$emit('save')">{{
        saveText
      }}</a-button>
    </span>
  </span>
</template>

<script setup>
const props = defineProps({
  isEdit: {
      type: Boolean,
      required: true
    },
    editText: {
      type: String,
      default: '编辑'
    },
    cancelText: {
      type: String,
      default: '取消'
    },
    saveText: {
      type: String,
      default: '保存'
    }
})


</script>

<style lang="less" scoped>
.edit_save_button {
  .gray_btn {
    color: #999;
  }
  .lrpadding {
  padding: 0 12px;
}
}
</style>
